package chapter03;

//import chapter04.User17;

import chapter04.Java17_Object_Access;

public class Java01_FlowControl {
    public static void main(String[] args) {
        // TODO 流程控制
        // 计算机在执行代码时对指令代码执行顺序的控制(按照事情的安排顺序一个一个完成)
        /*
            Java中的流程控制分类：
            1.顺序执行：代码出现的先后顺序以及语法出现的先后顺序
            2.分支执行
            3.重复执行
         */
        // TODO 顺序执行
        // 变量在使用前必须声明且初始化
        int i = 10;
        int j = 20;
        System.out.println(i + j);

        // User17 user = new User17(); 报错：'chapter04.User17' is not public in 'chapter04'. Cannot be accessed from outside package
        Java17_Object_Access user = new Java17_Object_Access();
        // System.out.println(user.name); 报错：'name' has private access in 'chapter04.Java17_Object_Access'
        System.out.println(user.userName);
        // System.out.println(user.sex); 报错：'chapter04.User17' is not public in 'chapter04'. Cannot be accessed from outside package
    }
}
